package cn.paul.wechatshop.service;

import cn.paul.wechatshop.common.ServerResponse;
import cn.paul.wechatshop.dto.CartDTO;
import cn.paul.wechatshop.entity.ProductInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author 徐凌峰
 * @date 2017/12/10 0010
 */
public interface IProductInfoService {

    ServerResponse<List<ProductInfo>> findByProductStatus(Integer productStatus);

    ServerResponse<ProductInfo> save(ProductInfo productInfo);

    ServerResponse<ProductInfo> findOne(String productId);

    /**
     * 后台查询所有在售商品
     *
     * @return
     */
    ServerResponse<Page<ProductInfo>> findUpAll(Pageable pageable);

    ServerResponse<Page<ProductInfo>> findAll(Pageable pageable);

    //增减库存

    void increaseStock(List<CartDTO> cartDTOList);

    void decreaseStock(List<CartDTO> cartDTOList);


}
